<?php

class productComponents extends sfComponents
{
	public function executeLeft_menu()
	{
	    //$this->selected = (int)$this->getRequestParameter('')
	    $this->categories = Category::getList(0);
	}

	/**
	 * return top category id
    */
    public function executeMenu_top()
    {
       $this->arParentsId = array();

       if($this->getRequestParameter('id'))
       {
           $this->arParentsId = Category::getParentsId($this->getRequestParameter('id'), 0);
           
           if(count($this->arParentsId))
           {
                $this->topCategoryId = $this->arParentsId[0];
           }
           else
           {
                $this->topCategoryId = '';
           }
            
           
           //$this->arBranch = Category::getBranchById($this->getRequestParameter('id'));
       }
       
       //debugvar($this->arParentsId, 'parentsId');
       
    }
}
